import QtQuick 2.14
import QtQuick.Window 2.14
import QtQuick.Controls 2.14
import QtCharts 2.14
//30日数据分析模块
Item {
    id: rootitem
    anchors.fill: parent
    property var name : ["温度","湿度","光照","可燃性气体"]
    Image {
        id: hjjkbj1
        source: "/huanjingjkong_4.bmp"
        MouseArea {//返回
            x: 0
            y: 0
            width: 90
            height: 80
            onClicked: {
                rootLoader.source = "Shujufenxi.qml"
            }
        }
    }
    ChartView {//数据折线图
        id: chartview
        anchors.fill: parent
        anchors.topMargin: 60
//        title: "近30日数据分析报告"
        antialiasing: true
        ValueAxis {
            id: xAxis
            min: 0
            max: 30
            tickCount: 6
        }
        ValueAxis {
            id: yAxis
            min: 0
            max: 100
            tickCount: 10
        }
    }
    Component.onCompleted: {
        for (var j = 0; j < 4; j++) {
            var line = chartview.createSeries(ChartView.SeriesTypeLine,name[j],xAxis,yAxis)
            for (var i = 1; i <= 30; i++) {
                line.append(i,winroot.ans[j][i-1]);
            }
        }
    }
}
